#include "TIM1_PWM.h"

extern TIM_HandleTypeDef htim1;


void TIM1_Set_PWM(uint16_t PWM_Freq,uint16_t PWM_Duty)
{
	uint16_t TIM_ARR = 100000.f / PWM_Freq;
	TIM1->ARR = TIM_ARR;
	__HAL_TIM_SetCompare(&htim1,TIM_CHANNEL_1,TIM_ARR * PWM_Duty/100);
}


